# -*- coding:utf-8 -*-
# @Time: 2020/9/24 21:17
# @Author: 周铖鑫
# @Description：图中图
# @File: picture-in-picture.py
import matplotlib.pyplot as plt
fig=plt.figure(num="图中图")
x=[1,2,3,4,5]
y=[4,3,6,4,9]
left,bottom,width,height=0.1,0.1,0.8,0.8
ax1=fig.add_axes([left,bottom,width,height])
ax1.plot(x,y,'r')
ax1.set_xlabel('x')
ax1.set_ylabel('y')
ax1.set_title('title')

left,bottom,width,height=0.2,0.6,0.25,0.25
ax1=fig.add_axes([left,bottom,width,height])
ax1.plot(x,y,'b')
ax1.set_xlabel('x')
ax1.set_ylabel('y')
ax1.set_title('inside 1')

plt.axes([0.6,0.2,0.25,0.25])
plt.plot(y[::-1],x,'g')
plt.xlabel('x')
plt.ylabel('y')
plt.title('inside 2')
plt.show()